# 返回杨慧三角的第k行
def yanghuiTriangle(rowIndex):
    row = [1] * (rowIndex + 1)
    for i in range(1, rowIndex):
        for j in range(i, 0, -1):
            row[j] += row[j - 1]
            # print(i, j, row)
    return row


#
print(yanghuiTriangle(0))  # [1]
print(yanghuiTriangle(1))  # [[1]]
print(yanghuiTriangle(2))  # [[1], [1, 1]]
print(yanghuiTriangle(3))  # [[1], [1, 1], [1, 2, 1]]
print(yanghuiTriangle(5))  # [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]
